﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaweiCloud.Dotnet.Samples.Common.Extensions
{
    public static class DateTimeExtension
    {
        public static string ToYMD(this DateTime self, DateTime? time = null)
        {
            DateTime res = time == null ? self : time.Value;
            return res.ToString("yyyy-MM-dd");
        }
    }
}
